
class FileUtils{
  //获取文件名
  static String getFileName({String? filePath:''}){
    if(filePath==null)return'';
    List<String> filePaths = filePath.split('/');
    if(filePaths.length<2){
      return filePaths[0];
    }else{
      return filePaths[filePaths.length-1];
    }
  }
  //获取文件后缀
  static String getFileNameSuffix({String filePath:''}){
    if(filePath==null)return'';
    List<String> filePaths = filePath.split('.');
    if(filePaths.length<2){
      return filePaths[0];
    }else{
      return filePaths[filePaths.length-1];
    }

  }
}